﻿using SqlSugar;
using System;

namespace TiaoTiaoCode.AutoUpdate.DbCore.Entities
{
    /// <summary>
    /// 日志表
    /// </summary>
    [SugarTable("sys_log")]
    public class SysLog
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(ColumnName = "id", Length = 64, IsPrimaryKey = true)]
        public string Id { get; set; } = Guid.NewGuid().ToString();

        /// <summary>
        /// 日志时间
        /// </summary>
        [SugarColumn(ColumnName = "log_date")]
        public DateTime LogDate { get; set; } = DateTime.Now;

        /// <summary>
        /// 方法名
        /// </summary>
        [SugarColumn(ColumnName = "method", Length = 200, IsNullable = true)]
        public string? Method { get; set; } = default!;

        /// <summary>
        /// 操作的表名
        /// </summary>
        [SugarColumn(ColumnName = "table_name", Length = 200, IsNullable = true)]
        public string? TableName { get; set; } = default!;

        /// <summary>
        /// 操作类型
        /// </summary>
        [SugarColumn(ColumnName = "operate_type", Length = 50, IsNullable = true)]
        public string? OperateType { get; set; } = default!;

        /// <summary>
        /// 操作数据
        /// </summary>
        [SugarColumn(ColumnName = "log_data", ColumnDataType = "text", IsNullable = true)]
        public string? LogData { get; set; } = default!;
    }
}
